<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <title>社交活动平台 - 发布活动</title>
    <style>
        /* 重置样式 */
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
            background-color: #f5f7fa;
            color: #333;
            line-height: 1.6;
        }

        /* 容器样式 */
        .container {
            max-width: 480px;
            margin: 0 auto;
            background-color: #fff;
            min-height: 100vh;
        }

        /* 头部导航 */
        .header {
            position: sticky;
            top: 0;
            background-color: white;
            padding: 16px;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
            z-index: 100;
        }

        .header-content {
            display: flex;
            align-items: center;
            justify-content: space-between;
        }

        .back-btn {
            background: none;
            border: none;
            font-size: 24px;
            cursor: pointer;
            color: #333;
        }

        .header-title {
            font-size: 18px;
            font-weight: bold;
            flex-grow: 1;
            text-align: center;
        }

        .save-btn {
            background: none;
            border: none;
            font-size: 16px;
            color: #ff6b35;
            cursor: pointer;
        }

        /* 表单区域 */
        .form-container {
            padding: 20px;
        }

        .form-section {
            margin-bottom: 30px;
        }

        .section-title {
            font-size: 18px;
            font-weight: bold;
            margin-bottom: 16px;
            color: #333;
        }

        /* 输入框样式 */
        .form-input {
            width: 100%;
            padding: 14px 16px;
            border-radius: 12px;
            border: 1px solid #ddd;
            font-size: 16px;
            margin-bottom: 16px;
            outline: none;
            transition: border-color 0.3s ease;
        }

        .form-input:focus {
            border-color: #ff6b35;
        }

        /* 文本域样式 */
        .form-textarea {
            width: 100%;
            padding: 14px 16px;
            border-radius: 12px;
            border: 1px solid #ddd;
            font-size: 16px;
            min-height: 120px;
            resize: vertical;
            margin-bottom: 16px;
            outline: none;
            transition: border-color 0.3s ease;
        }

        .form-textarea:focus {
            border-color: #ff6b35;
        }

        /* 选择器样式 */
        .form-select {
            width: 100%;
            padding: 14px 16px;
            border-radius: 12px;
            border: 1px solid #ddd;
            font-size: 16px;
            background-color: white;
            margin-bottom: 16px;
            outline: none;
            transition: border-color 0.3s ease;
        }

        .form-select:focus {
            border-color: #ff6b35;
        }

        /* 标签选择器 */
        .tag-selector {
            display: flex;
            gap: 10px;
            margin-bottom: 20px;
            flex-wrap: wrap;
        }

        .tag-option {
            padding: 8px 16px;
            border-radius: 20px;
            background-color: #f0f8ff;
            color: #45b7d1;
            font-size: 14px;
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .tag-option:hover {
            background-color: #e1f0ff;
        }

        .tag-option.selected {
            background-color: #45b7d1;
            color: white;
        }

        /* 图片上传区域 */
        .image-upload-area {
            border: 2px dashed #ddd;
            border-radius: 12px;
            padding: 30px 20px;
            text-align: center;
            margin-bottom: 16px;
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .image-upload-area:hover {
            border-color: #ff6b35;
            background-color: rgba(255, 107, 53, 0.05);
        }

        .image-upload-icon {
            font-size: 48px;
            color: #ff6b35;
            margin-bottom: 12px;
        }

        .image-upload-text {
            color: #666;
            margin-bottom: 8px;
        }

        .image-upload-subtext {
            font-size: 14px;
            color: #999;
        }

        .preview-images {
            display: flex;
            gap: 10px;
            margin-top: 16px;
            overflow-x: auto;
            padding-bottom: 8px;
        }

        .preview-image {
            width: 100px;
            height: 100px;
            border-radius: 8px;
            object-fit: cover;
            position: relative;
        }

        .remove-image {
            position: absolute;
            top: -8px;
            right: -8px;
            background-color: #ff6b35;
            color: white;
            border-radius: 50%;
            width: 24px;
            height: 24px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 14px;
            cursor: pointer;
        }

        /* 时间选择器 */
        .time-selector {
            display: flex;
            gap: 12px;
            margin-bottom: 16px;
        }

        .time-item {
            flex: 1;
        }

        /* 按钮区域 */
        .button-section {
            padding: 20px;
            background-color: white;
            border-top: 1px solid #eee;
            position: sticky;
            bottom: 0;
            z-index: 99;
        }

        .publish-btn {
            width: 100%;
            background: linear-gradient(135deg, #ff6b35 0%, #f9a825 100%);
            color: white;
            border: none;
            padding: 16px;
            border-radius: 24px;
            font-size: 18px;
            font-weight: bold;
            cursor: pointer;
            transition: all 0.3s ease;
            box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
        }

        .publish-btn:hover {
            transform: scale(1.02);
            box-shadow: 0 6px 16px rgba(255, 107, 53, 0.4);
        }

        .publish-btn:disabled {
            background: #9e9e9e;
            cursor: not-allowed;
            transform: none;
            box-shadow: 0 2px 8px rgba(158, 158, 158, 0.3);
        }

        /* 底部导航 */
        .bottom-nav {
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            background-color: white;
            border-top: 1px solid #eee;
            display: flex;
            justify-content: space-around;
            padding: 12px 0;
            z-index: 100;
        }

        .nav-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            color: #9e9e9e;
            font-size: 12px;
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .nav-item.active {
            color: #ff6b35;
        }

        .nav-icon {
            font-size: 20px;
            margin-bottom: 4px;
        }

        /* 加载动画 */
        .loading {
            text-align: center;
            padding: 40px 20px;
        }

        .spinner {
            width: 36px;
            height: 36px;
            border: 4px solid #f3f3f3;
            border-top: 4px solid #ff6b35;
            border-radius: 50%;
            animation: spin 1s linear infinite;
            margin: 0 auto 20px;
        }

        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }

        /* 弹窗样式 */
        .modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background-color: rgba(0, 0, 0, 0.5);
            z-index: 1000;
            justify-content: center;
            align-items: center;
        }

        .modal-content {
            background-color: white;
            border-radius: 16px;
            width: 85%;
            max-width: 320px;
            padding: 24px;
            text-align: center;
            transform: translateY(20px);
            opacity: 0;
            transition: all 0.3s ease;
        }

        .modal.show {
            transform: translateY(0);
            opacity: 1;
        }

        .modal-title {
            font-size: 20px;
            font-weight: bold;
            margin-bottom: 16px;
            color: #333;
        }

        .modal-message {
            margin-bottom: 24px;
            color: #666;
            line-height: 1.6;
        }

        .modal-actions {
            display: flex;
            gap: 12px;
        }

        .modal-btn {
            flex: 1;
            padding: 12px;
            border-radius: 8px;
            font-weight: bold;
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .cancel-btn {
            background-color: #f5f5f5;
            color: #666;
        }

        .confirm-btn {
            background: linear-gradient(135deg, #ff6b35 0%, #f9a825 100%);
            color: white;
        }

        /* 响应式适配 */
        @media (max-width: 480px) {
            .header-content {
                padding-top: 4px;
            }
            
            .form-input, 
            .form-textarea,
            .form-select {
                padding: 12px 14px;
                font-size: 16px;
            }
        }

        /* 动画效果 */
        @keyframes fadeInUp {
            from {
                opacity: 0;
                transform: translateY(20px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        .form-section {
            animation: fadeInUp 0.6s ease forwards;
        }

        /* 按钮状态动画 */
        .publish-btn {
            animation: buttonPulse 2s infinite;
        }

        @keyframes buttonPulse {
            0% { box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3); }
            50% { box-shadow: 0 6px 16px rgba(255, 107, 53, 0.4); }
            100% { box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3); }
        }

        /* 活动类型标签颜色 */
        .tag-sport { background-color: #e3f2fd; color: #1976d2; }
        .tag-learning { background-color: #f3e5f5; color: #7b1fa2; }
        .tag-social { background-color: #e8f5e9; color: #388e3c; }
        .tag-food { background-color: #fff3e0; color: #f57c00; }
        .tag-culture { background-color: #fce4ec; color: #c2185b; }
        .tag-outdoor { background-color: #e0f2f1; color: #00796b; }
    </style>
</head>
<body>
    <div class="container">
        <!-- 头部导航 -->
        <header class="header">
            <div class="header-content">
                <button class="back-btn" id="backBtn">←</button>
                <div class="header-title">发布活动</div>
                <button class="save-btn" id="saveBtn">保存草稿</button>
            </div>
        </header>

        <!-- 表单区域 -->
        <div class="form-container">
            <!-- 活动封面上传 -->
            <div class="form-section">
                <h3 class="section-title">活动封面</h3>
                <div class="image-upload-area" id="uploadArea">
                    <div class="image-upload-icon">📷</div>
                    <p class="image-upload-text">点击上传活动封面</p>
                    <p class="image-upload-subtext">支持JPG、PNG格式，建议尺寸1080×600</p>
                </div>
                
                <!-- 图片预览区域 -->
                <div class="preview-images" id="imagePreview">
                    <!-- 预览图片将在这里显示 -->
                </div>
            </div>

            <!-- 活动基本信息 -->
            <div class="form-section">
                <h3 class="section-title">活动基本信息</h3>
                
                <!-- 活动标题 -->
                <input type="text" class="form-input" id="activityTitle" placeholder="请输入活动标题（如：周末户外徒步）">
                
                <!-- 活动类型 -->
                <select class="form-select" id="activityType">
                    <option value="">请选择活动类型</option>
                    <option value="sport">运动健身</option>
                    <option value="learning">学习分享</option>
                    <option value="social">社交聚会</option>
                    <option value="food">美食探店</option>
                    <option value="culture">文化体验</option>
                    <option value="outdoor">户外活动</option>
                </select>

                <!-- 活动标签 -->
                <h4 class="section-title">活动标签</h4>
                <div class="tag-selector" id="tagSelector">
                    <div class="tag-option selected" data-tag="sport">运动</div>
                    <div class="tag-option" data-tag="outdoor">户外</div>
                    <div class="tag-option" data-tag="learning">学习</div>
                    <div class="tag-option" data-tag="social">社交</div>
                    <div class="tag-option" data-tag="food">美食</div>
                    <div class="tag-option" data-tag="culture">文化</div>
                </div>

                <!-- 活动时间 -->
                <h4 class="section-title">活动时间</h4>
                <div class="time-selector">
                    <div class="time-item">
                        <input type="date" class="form-input" id="activityDate" value="2024-01-15">
                    </div>
                    <div class="time-item">
                        <input type="time" class="form-input" id="activityTime" value="14:00">
                    </div>
                </div>

                <!-- 活动地点 -->
                <input type="text" class="form-input" id="activityLocation" placeholder="请输入活动地点（如：城市公园）">
                
                <!-- 参与人数限制 -->
                <input type="number" class="form-input" id="maxParticipants" placeholder="参与人数限制（可选）">
            </div>

            <!-- 活动详情 -->
            <div class="form-section">
                <h3 class="section-title">活动详情</h3>
                
                <!-- 活动描述 -->
                <textarea class="form-textarea" id="activityDescription" placeholder="请输入活动详细介绍（包括活动流程、注意事项等）">
这是一次轻松愉快的户外徒步活动，我们将沿着城市公园的自然步道进行探索。活动全程约3小时，适合所有年龄段的朋友参加。我们会提供基础的徒步装备，以及饮用水和简单的零食补给。活动过程中大家可以相互交流，结识新朋友，享受大自然的美好时光。
                </textarea>
                
                <!-- 活动费用 -->
                <input type="text" class="form-input" id="activityFee" placeholder="活动费用（如：免费、10元/人）">
            </div>

            <!-- 附加信息 -->
            <div class="form-section">
                <h3 class="section-title">附加信息</h3>
                
                <!-- 联系方式 -->
                <input type="text" class="form-input" id="contactInfo" placeholder="联系方式（手机号/微信）">
                
                <!-- 注意事项 -->
                <textarea class="form-textarea" id="notes" placeholder="注意事项（如：请穿着运动鞋、自备水杯等）">
1. 请穿着舒适的运动服装和鞋子
2. 建议自备水杯和防晒用品
3. 活动过程中请注意安全，听从组织者安排
4. 如遇恶劣天气活动将延期或取消，请关注通知
                </textarea>
            </div>
        </div>

        <!-- 发布按钮 -->
        <div class="button-section">
            <button class="publish-btn" id="publishBtn">发布活动</button>
        </div>

        <!-- 底部导航 -->
        <nav class="bottom-nav">
            <div class="nav-item" data-page="home">
                <span class="nav-icon">🏠</span>
                <span>首页</span>
            </div>
            <div class="nav-item" data-page="search">
                <span class="nav-icon">🔍</span>
                <span>搜索</span>
            </div>
            <div class="nav-item active" data-page="publish">
                <span class="nav-icon">➕</span>
                <span>发布</span>
            </div>
            <div class="nav-item" data-page="profile">
                <span class="nav-icon">👤</span>
                <span>我的</span>
            </div>
        </nav>

        <!-- 发布确认弹窗 -->
        <div class="modal" id="publishModal">
            <div class="modal-content">
                <h3 class="modal-title">确认发布</h3>
                <p class="modal-message" id="publishMessage">
                    您确定要发布这个活动吗？<br>
                    发布后需要等待审核通过才能展示给其他用户。
                </p>
                <div class="modal-actions">
                    <button class="modal-btn cancel-btn" id="cancelPublishBtn">取消</button>
                    <button class="modal-btn confirm-btn" id="confirmPublishBtn">确认发布</button>
                </div>
            </div>
        </div>

        <!-- 保存草稿弹窗 -->
        <div class="modal" id="saveDraftModal">
            <div class="modal-content">
                <h3 class="modal-title">保存草稿</h3>
                <p class="modal-message" id="saveDraftMessage">
                    活动信息已保存到草稿箱，您可以稍后继续编辑。
                </p>
                <div class="modal-actions">
                    <button class="modal-btn confirm-btn" id="confirmSaveBtn">确定</button>
                </div>
            </div>
        </div>

        <!-- 加载状态 -->
        <div class="loading" id="loadingIndicator">
            <div class="spinner"></div>
            <p>加载中...</p>
        </div>

        <!-- 通知 Toast -->
        <div id="toast" style="display: none; position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background-color: #4caf50; color: white; padding: 12px 24px; border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.15); z-index: 1001;"></div>
    </div>

    <script>
        // 全局变量
        let uploadedImages = [];
        let selectedTags = ['sport'];
        const tagOptions = document.querySelectorAll('.tag-option');

        // 初始化
        document.addEventListener('DOMContentLoaded', function() {
            initEventListeners();
            simulateLoading();
            
            // 初始化日期时间选择器
            const today = new Date().toISOString().split('T')[0];
            document.getElementById('activityDate').value = today;
        });

        // 初始化事件监听器
        function initEventListeners() {
            // 返回按钮
            document.getElementById('backBtn').addEventListener('click', function() {
                if (hasUnsavedChanges()) {
                    showConfirmModal('您有未保存的更改，确定要离开吗？', function() {
                        window.history.back();
                    });
                } else {
                    window.history.back();
                }
            });

            // 保存草稿按钮
            document.getElementById('saveBtn').addEventListener('click', function() {
                saveDraft();
            });

            // 图片上传区域
            document.getElementById('uploadArea').addEventListener('click', function() {
                simulateImageUpload();
            });

            // 标签选择
            tagOptions.forEach(option => {
                option.addEventListener('click', function() {
                    const tag = this.dataset.tag;
                    
                    if (this.classList.contains('selected')) {
                        // 如果已选中，则取消选择（但至少保留一个）
                        if (selectedTags.length > 1) {
                            this.classList.remove('selected');
                            selectedTags = selectedTags.filter(t => t !== tag);
                        }
                    } else {
                        // 选择新标签
                        this.classList.add('selected');
                        selectedTags.push(tag);
                    }
                    
                    // 更新标签显示
                    updateTagDisplay();
                });
            });

            // 发布按钮
            document.getElementById('publishBtn').addEventListener('click', function() {
                if (validateForm()) {
                    showPublishModal();
                } else {
                    alert('请填写完整的信息');
                }
            });

            // 确认发布按钮
            document.getElementById('confirmPublishBtn').addEventListener('click', function() {
                publishActivity();
                closePublishModal();
            });

            // 取消发布按钮
            document.getElementById('cancelPublishBtn').addEventListener('click', closePublishModal);

            // 确认保存草稿按钮
            document.getElementById('confirmSaveBtn').addEventListener('click', function() {
                closeSaveDraftModal();
            });

            // 弹窗背景点击关闭
            document.querySelectorAll('.modal').forEach(modal => {
                modal.addEventListener('click', function(e) {
                    if (e.target === this) {
                        closeAllModals();
                    }
                });
            });

            // 底部导航切换
            const navItems = document.querySelectorAll('.nav-item');
            navItems.forEach(item => {
                item.addEventListener('click', function() {
                    // 移除所有激活状态
                    navItems.forEach(i => i.classList.remove('active'));
                    // 添加当前激活状态
                    this.classList.add('active');
                    
                    const page = this.dataset.page;
                    handleNavigation(page);
                });
            });

            // 监听表单变化
            const formInputs = document.querySelectorAll('input, textarea, select');
            formInputs.forEach(input => {
                input.addEventListener('change', function() {
                    // 可以添加实时验证或保存逻辑
                });
            });

            // 模拟表单自动填充（用于演示）
            setTimeout(() => {
                document.getElementById('activityTitle').value = '周末户外徒步活动';
                document.getElementById('activityLocation').value = '城市公园';
                document.getElementById('maxParticipants').value = '15';
            }, 1000);
        }

        // 检查是否有未保存的更改
        function hasUnsavedChanges() {
            const inputs = document.querySelectorAll('input, textarea');
            for (let input of inputs) {
                if (input.value.trim() !== '') {
                    return true;
                }
            }
            return false;
        }

        // 显示确认模态框
        function showConfirmModal(message, callback) {
            if (confirm(message)) {
                callback();
            }
        }

        // 显示发布确认弹窗
        function showPublishModal() {
            const modal = document.getElementById('publishModal');
            const message = document.getElementById('publishMessage');
            
            // 动态设置消息内容
            const title = document.getElementById('activityTitle').value || '未命名活动';
            message.innerHTML = `
                您确定要发布这个活动吗？<br>
                活动标题：${title}<br>
                发布后需要等待审核通过才能展示给其他用户。
            `;
            
            modal.classList.add('show');
        }

        // 关闭发布弹窗
        function closePublishModal() {
            const modal = document.getElementById('publishModal');
            modal.classList.remove('show');
        }

        // 显示保存草稿弹窗
        function showSaveDraftModal() {
            const modal = document.getElementById('saveDraftModal');
            modal.classList.add('show');
        }

        // 关闭保存草稿弹窗
        function closeSaveDraftModal() {
            const modal = document.getElementById('saveDraftModal');
            modal.classList.remove('show');
        }

        // 关闭所有弹窗
        function closeAllModals() {
            const modals = document.querySelectorAll('.modal');
            modals.forEach(modal => modal.classList.remove('show'));
        }

        // 处理导航切换
        function handleNavigation(page) {
            switch(page) {
                case 'home':
                    alert('跳转到首页');
                    break;
                case 'search':
                    alert('跳转到搜索页面');
                    break;
                case 'publish':
                    // 发布页面无需特殊处理
                    break;
                case 'profile':
                    alert('跳转到个人中心');
                    break;
            }
        }

        // 显示加载状态
        function showLoading() {
            const loading = document.getElementById('loadingIndicator');
            loading.style.display = 'block';
        }

        // 隐藏加载状态
        function hideLoading() {
            const loading = document.getElementById('loadingIndicator');
            loading.style.display = 'none';
        }

        // 模拟加载效果
        function simulateLoading() {
            showLoading();
            setTimeout(() => {
                hideLoading();
            }, 1500);
        }

        // 显示成功提示
        function showSuccessToast(message) {
            const toast = document.getElementById('toast');
            toast.textContent = message;
            toast.style.display = 'block';
            
            // 3秒后自动隐藏
            setTimeout(() => {
                toast.style.display = 'none';
            }, 3000);
        }

        // 模拟图片上传
        function simulateImageUpload() {
            if (uploadedImages.length >= 3) {
                alert('最多只能上传3张图片');
                return;
            }
            
            // 模拟上传成功
            const imagePreview = document.getElementById('imagePreview');
            const imgCount = uploadedImages.length + 1;
            
            // 创建预览元素
            const previewDiv = document.createElement('div');
            previewDiv.className = 'preview-image-container';
            previewDiv.innerHTML = `
                <img src="https://picsum.photos/100/100?random=${Date.now()}" alt="预览图片" class="preview-image">
                <div class="remove-image">×</div>
            `;
            
            imagePreview.appendChild(previewDiv);
            
            // 添加删除功能
            const removeBtn = previewDiv.querySelector('.remove-image');
            removeBtn.addEventListener('click', function(e) {
                e.stopPropagation();
                previewDiv.remove();
                // 从上传数组中移除
                uploadedImages = uploadedImages.filter(img => img !== previewDiv);
            });
            
            // 添加到上传数组
            uploadedImages.push(previewDiv);
            
            showSuccessToast('图片上传成功！');
        }

        // 验证表单
        function validateForm() {
            const title = document.getElementById('activityTitle').value.trim();
            const type = document.getElementById('activityType').value;
            const location = document.getElementById('activityLocation').value.trim();
            
            if (!title || !type || !location) {
                return false;
            }
            
            // 检查标签选择
            if (selectedTags.length === 0) {
                return false;
            }
            
            return true;
        }

        // 更新标签显示
        function updateTagDisplay() {
            tagOptions.forEach(option => {
                const tag = option.dataset.tag;
                if (selectedTags.includes(tag)) {
                    option.classList.add('selected');
                } else {
                    option.classList.remove('selected');
                }
            });
        }

        // 保存草稿
        function saveDraft() {
            const formData = collectFormData();
            
            // 模拟保存到本地存储
            localStorage.setItem('draftActivity', JSON.stringify(formData));
            
            // 显示保存成功提示
            showSaveDraftModal();
            showSuccessToast('草稿已保存！');
        }

        // 收集表单数据
        function collectFormData() {
            return {
                title: document.getElementById('activityTitle').value,
                type: document.getElementById('activityType').value,
                tags: selectedTags,
                date: document.getElementById('activityDate').value,
                time: document.getElementById('activityTime').value,
                location: document.getElementById('activityLocation').value,
                maxParticipants: document.getElementById('maxParticipants').value,
                description: document.getElementById('activityDescription').value,
                fee: document.getElementById('activityFee').value,
                contactInfo: document.getElementById('contactInfo').value,
                notes: document.getElementById('notes').value
            };
        }

        // 发布活动
        function publishActivity() {
            const formData = collectFormData();
            
            // 模拟发布过程
            showLoading();
            
            setTimeout(() => {
                hideLoading();
                
                // 显示成功提示
                showSuccessToast('活动发布成功！正在审核中...');
                
                // 重置表单
                resetForm();
            }, 2000);
        }

        // 重置表单
        function resetForm() {
            const formInputs = document.querySelectorAll('input, textarea, select');
            formInputs.forEach(input => {
                if (input.type === 'checkbox' || input.type === 'radio') {
                    input.checked = false;
                } else if (input.tagName === 'SELECT') {
                    input.value = '';
                } else {
                    input.value = '';
                }
            });
            
            // 重置标签选择
            selectedTags = ['sport'];
            updateTagDisplay();
            
            // 清空图片预览
            document.getElementById('imagePreview').innerHTML = '';
            uploadedImages = [];
        }

        // 添加触摸反馈效果
        const buttons = document.querySelectorAll('button');
        buttons.forEach(button => {
            button.addEventListener('touchstart', function() {
                this.style.transform = 'scale(0.95)';
            });
            
            button.addEventListener('touchend', function() {
                this.style.transform = 'scale(1)';
            });
        });

        // 添加页面滚动效果
        let lastScrollTop = 0;
        window.addEventListener('scroll', function() {
            const scrollTop = window.pageYOffset || document.documentElement.scrollTop;
            
            // 隐藏/显示底部导航
            const bottomNav = document.querySelector('.bottom-nav');
            if (scrollTop > lastScrollTop && scrollTop > 100) {
                bottomNav.style.transform = 'translateY(100%)';
            } else {
                bottomNav.style.transform = 'translateY(0)';
            }
            
            lastScrollTop = scrollTop;
        });

        // 添加返回顶部功能
        window.addEventListener('scroll', function() {
            if (window.pageYOffset > 300) {
                // 可以添加返回顶部按钮
            }
        });
    </script>
</body>
</html>
